home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 4⁄27⁄90 / 0113-Re Value parameter..-Apr90 < prev    next >
Encoding:
Text File  |  1990-04-27  |  994 b   |  30 lines  |  [TEXT/GEOL]

  1. Item    5716110                         26-April-90        20:21PDT
  2.  
  3. From:   D0532                           Aidea Systems, Don Park,PRT
  4.  
  5. To:     CPLUS.DEV$                      C++ Interest List--Developers
  6.         CPLUS.APPLE$                    C++ Interest List--Apple Employees
  7.  
  8. Sub:    Re: Value parameter..
  9.  
  10. I think what Derek pointed out might be a bug in CFront translator.  The CFront
  11. translator inserts following code into the copy constructor.
  12.  
  13.     this-> __vptr= (struct __mptr *)TShape::__ptbl;
  14.  
  15. This code initializes the virtual table pointer of the instance, but rather
  16. than initializing by COPYING, it stuffs TShape::__ptbl which is a global static
  17. array of virtual function pointers.
  18.  
  19. It makes you wonder why the CFront doesn't simply copy the __vptr from the
  20. TShape being copied?
  21.  
  22. i.e.    this->__vptr = (struct __mptr *)s->__vptr;
  23.  
  24.         where s is from TShape::TShape ( const TShape & s );
  25.  
  26. This should work the way Derek White originally thought.
  27.  
  28. Don Park
  29.  
  30.